package com.neu.niuyuchao.servlet;

import com.neu.niuyuchao.dao.MgrApproveDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet(name = "CheckhistoryServlet", urlPatterns = {"/CheckhistoryServlet.do"})
public class CheckhistoryServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        MgrApproveDaoImpl d=new MgrApproveDaoImpl();
        List<Map<String,Object>>list=d.checkhistory();
        HttpSession session=request.getSession();
        session.setAttribute("history",list);
        request.getRequestDispatcher("WEB-INF/Mgr/spjilu.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
